package jsyf.oa.entity.device;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by 92852 on 2018/3/22.
 */
@Entity
@Table(name = "T_DVC_CUSTOMER", schema = "oa", catalog = "")
public class CustomerEntity extends BaseEntity {

    private String name;

    private String idCard;

    private String tel;

    private String deliveryAddress;

    private String deviceAdministrator;
    private String administratorTel;
    private String deviceOperator;
    private String operatorTel;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getDeliveryAddress() {
        return deliveryAddress;
    }

    public void setDeliveryAddress(String deliveryAddress) {
        this.deliveryAddress = deliveryAddress;
    }

    public String getDeviceAdministrator() {
        return deviceAdministrator;
    }

    public void setDeviceAdministrator(String deviceAdministrator) {
        this.deviceAdministrator = deviceAdministrator;
    }

    public String getAdministratorTel() {
        return administratorTel;
    }

    public void setAdministratorTel(String administratorTel) {
        this.administratorTel = administratorTel;
    }

    public String getDeviceOperator() {
        return deviceOperator;
    }

    public void setDeviceOperator(String deviceOperator) {
        this.deviceOperator = deviceOperator;
    }

    public String getOperatorTel() {
        return operatorTel;
    }

    public void setOperatorTel(String operatorTel) {
        this.operatorTel = operatorTel;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID", this.getId());
        obj.put("ID_CARD", this.getIdCard());
        obj.put("NAME", this.getName());
        obj.put("TEL", this.getTel());
        obj.put("DELIVERY_ADDRESS", this.getDeliveryAddress());

        obj.put("DEVICE_ADMINISTRATOR", this.getDeviceAdministrator());
        obj.put("ADMINISTRATOR_TEL", this.getAdministratorTel());
        obj.put("DEVICE_OPERATOR", this.getDeviceOperator());
        obj.put("OPERATOR_TEL", this.getOperatorTel());

        return obj;
    }

    @Override
    public String getTableName() {
        return "T_DVC_CUSTOMER";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("DELIVERY_ADDRESS", "deliveryAddress");
        obj.put("NAME", "name");
        obj.put("ID_CARD", "idCard");
        obj.put("TEL", "tel");

        obj.put("DEVICE_ADMINISTRATOR", "deviceAdministrator");
        obj.put("ADMINISTRATOR_TEL", "administratorTel");
        obj.put("DEVICE_OPERATOR", "deviceOperator");
        obj.put("OPERATOR_TEL", "operatorTel");

        return obj;
    }
}
